<?php

//include_once ("../configure/configure.php");		//-- global var
include_once("./configure/admin.config.inc.php");	//--> global var
include_once("db.inc.php");						//--> db global var
include_once("Smarty.class.php");				//--> out template
include_once("impl/AuthImpl.php");					//--> Authority
require_once("controlHeader.php");				//--> system control header

$authImpl 	= new AuthImpl(DB_TAG_SYSTEM);		//--> Authority

$navigation 	= 'Welcome';
$strSubFrameUrl = "templates/en-US/welcome.htm";


$arrMenuList = $authImpl->getMenuFromGroupID($gid);

if(isset($_GET['menuGid']) && isset($_GET['menuid']) && is_array($arrMenuList)){
	foreach ($arrMenuList as $cache){
		foreach ($cache as $arrValue){
			if($arrValue['mid'] == $_GET['menuid']){
				$strSubFrameUrl = $arrValue['url'] . "?menuGid=$menuGid&menuid=$menuid";
				
				$navigation = $arrValue['gname'] . ' > ' . $arrValue['mname'];
			}
		}
	}
}

/*----- out html -----*/
$smarty = new Smarty();	//-- out template
$smarty->template_dir = TEMPLATE_SYS_DIR;
$smarty->compile_dir  = COMPILE_SYS_DIR;

$smarty->assign('arrMenuList', $arrMenuList);
$smarty->assign('initGid', $menuGid);

$smarty->assign('userName', $sessionImpl->getUserName());
$smarty->assign('navigation', $navigation);

$smarty->assign('subFrameUrl', $strSubFrameUrl);

$smarty->display('main.htm');
?>
